package p270jp.pxv.android.activity;

import android.annotation.SuppressLint;
import android.os.Bundle;
import androidx.databinding.DataBindingUtil;
import androidx.recyclerview.widget.LinearLayoutManager;
import com.google.android.material.snackbar.Snackbar;
import p014ae.AbstractActivityC0128o0;
import p014ae.C0185y;
import p045be.FollowLiveAdapter;
import p047bg.C1124a;
import p071cd.Functions;
import p090d0.C2518n;
import p134ei.AnalyticsScreenName;
import p165fo.C3114c;
import p165fo.Subscribe;
import p187gl.PixivRequest;
import p270jp.pxv.android.R;
import p270jp.pxv.android.event.UpdateMuteEvent;
import p270jp.pxv.android.model.ContentRecyclerViewState;
import p270jp.pxv.android.model.ResponseAttacher;
import p270jp.pxv.android.model.SketchLiveListType;
import p270jp.pxv.android.view.ContentRecyclerView;
import p314lg.ActivityLiveListBinding;
import p451qm.FollowLiveListItemDecoration;
import p484s6.C5998s;
import p607x0.C7050l;
import p639y6.C7292h;
import p639y6.C7296l;
import p665z6.C7461p;
import p665z6.C7469x;
import p677zi.PixivImageLoader;

/* renamed from: jp.pxv.android.activity.FollowLiveListActivity */
/* loaded from: classes2.dex */
public class FollowLiveListActivity extends AbstractActivityC0128o0 {

    /* renamed from: g0 */
    public static final /* synthetic */ int f18346g0;

    /* renamed from: b0 */
    public Snackbar f18347b0;

    /* renamed from: c0 */
    public Snackbar f18348c0;

    /* renamed from: d0 */
    public ActivityLiveListBinding f18349d0;

    /* renamed from: e0 */
    public FollowLiveAdapter f18350e0;

    /* renamed from: f0 */
    public final PixivImageLoader f18351f0 = (PixivImageLoader) C2518n.m7641d(PixivImageLoader.class);

    /* renamed from: jp.pxv.android.activity.FollowLiveListActivity$a */
    /* loaded from: classes2.dex */
    public static /* synthetic */ class C4004a {

        /* renamed from: a */
        public static final /* synthetic */ int[] f18352a;

        static {
            int[] iArr = new int[ContentRecyclerViewState.values().length];
            f18352a = iArr;
            try {
                iArr[ContentRecyclerViewState.START_RELOAD.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                f18352a[ContentRecyclerViewState.FINISH_RELOAD.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
            try {
                f18352a[ContentRecyclerViewState.ITEM_NOT_FOUND.ordinal()] = 3;
            } catch (NoSuchFieldError unused3) {
            }
            try {
                f18352a[ContentRecyclerViewState.ERROR_WHEN_RELOADED.ordinal()] = 4;
            } catch (NoSuchFieldError unused4) {
            }
            try {
                f18352a[ContentRecyclerViewState.ERROR_WHEN_LOADED_NEXT.ordinal()] = 5;
            } catch (NoSuchFieldError unused5) {
            }
            try {
                f18352a[ContentRecyclerViewState.TOO_MANY_MUTED_WHEN_RELOADED.ordinal()] = 6;
            } catch (NoSuchFieldError unused6) {
            }
            try {
                f18352a[ContentRecyclerViewState.TOO_MANY_MUTED_WHEN_LOADED_NEXT.ordinal()] = 7;
            } catch (NoSuchFieldError unused7) {
            }
            try {
                f18352a[ContentRecyclerViewState.NETWORK_NOT_CONNECTED_WHEN_RELOADING.ordinal()] = 8;
            } catch (NoSuchFieldError unused8) {
            }
            try {
                f18352a[ContentRecyclerViewState.NETWORK_NOT_CONNECTED_WHEN_LOADING_NEXT.ordinal()] = 9;
            } catch (NoSuchFieldError unused9) {
            }
            try {
                f18352a[ContentRecyclerViewState.END_NEXT.ordinal()] = 10;
            } catch (NoSuchFieldError unused10) {
            }
        }
    }

    @Override // p270jp.pxv.android.activity.AbstractActivityC4151b, p270jp.pxv.android.activity.BaseActivity, androidx.fragment.app.FragmentActivity, androidx.activity.ComponentActivity, p248j2.ActivityC3902g, android.app.Activity
    @SuppressLint({"RxJava2SubscribeMissingOnError"})
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        this.f18349d0 = (ActivityLiveListBinding) DataBindingUtil.m11369d(this, R.layout.activity_live_list);
        C3114c.m6284b().m6276j(this);
        C1124a.m10196R(this, this.f18349d0.f22171u, getString(R.string.follow_user_lives));
        ResponseAttacher responseAttacher = new ResponseAttacher(C7469x.f31308f, new C7296l(this, 3), new C7461p(this, 7));
        responseAttacher.setFilterItemsCallback(C5998s.f26025j);
        ContentRecyclerView contentRecyclerView = this.f18349d0.f22169s;
        contentRecyclerView.f19470J0 = new C7050l(PixivRequest.m5809h(SketchLiveListType.FOLLOWING));
        contentRecyclerView.f19471K0 = responseAttacher;
        contentRecyclerView.m4509v0();
        this.f18349d0.f22169s.getState().m984q(new C0185y(this, 0), Functions.f5388e, Functions.f5386c, Functions.f5387d);
        FollowLiveListItemDecoration bVar = new FollowLiveListItemDecoration(this);
        int r = C1124a.m10174r(this) - (bVar.f25465a * 2);
        this.f18350e0 = new FollowLiveAdapter(r / 2, r, this.f936e, this.f18351f0);
        this.f18349d0.f22169s.setLayoutManager(new LinearLayoutManager(1, false));
        this.f18349d0.f22169s.m10871g(bVar);
        this.f18349d0.f22169s.setAdapter(this.f18350e0);
        this.f18349d0.f22169s.m4506y0();
        this.f18349d0.f22170t.setOnRefreshListener(new C7292h(this, 4));
        this.f18757A.m6525e(AnalyticsScreenName.NEW_FOLLOW_LIVE);
    }

    @Override // p014ae.AdActivity, p270jp.pxv.android.activity.BaseActivity, p116e.ActivityC2727f, androidx.fragment.app.FragmentActivity, android.app.Activity
    public void onDestroy() {
        C3114c.m6284b().m6274l(this);
        Snackbar snackbar = this.f18347b0;
        if (snackbar != null) {
            snackbar.m8490b(3);
        }
        Snackbar snackbar2 = this.f18348c0;
        if (snackbar2 != null) {
            snackbar2.m8490b(3);
        }
        super.onDestroy();
    }

    @Subscribe
    public void onEvent(UpdateMuteEvent updateMuteEvent) {
        if (this.f18349d0.f22169s.getAdapter() != null) {
            this.f18349d0.f22169s.getAdapter().f3606a.m10780b();
        }
    }
}
